{% extends "dash/dashboard.html" %}

{% load dash_filters %}

{% block myjavascript %}
    <script language="javascript" src="/mymedia/js/myutils.js"></script>
{% endblock myjavascript %}

{% block mystylesheet-dashboard %}
    <link rel="stylesheet" href="/mymedia/css/styleMati.css" type="text/css" />
{% endblock mystylesheet-dashboard%}

{% block menuOptionsSelected %}
    <ul class="menu-options">
        <li class="menu-item"><a href="/dash/dashboard/">Dashboard</a></li>
        <li class="menu-item"><a href="/dash/logbook/">Logbook</a></li>
        <li class="menu-item"><a href="/dash/topicos/">Topicos</a></li>
    </ul>
{% endblock menuOptionsSelected %}

{% block dashboard %}
    <div class="eventos-content">
        <div class='eventos-titulo'>Mensajes por usuario</div>
        <div class="list-content-user-messages">
            {% if usuarios %}
                <ul>
                    {% for usuario in usuarios %}
                        <li class="content-user-messages">
                            <div class="user-message-image">
                                {% if usuario.persona.avatar %}
                                    <img src="{{ usuario.persona.avatar.url_50x50 }}" alt="Logo" />
                                {% else %}
                                    {% if usuario.persona %}
                                        {% if usuario.persona.sexo == "M" %}
                                            <img src="/mymedia/images/avatar-male.png" alt="Logo" />
                                        {% else %}
                                            <img src="/mymedia/images/avatar-famale.png" alt="Logo" />
                                        {% endif%}
                                    {% else %}
                                            <img src="/mymedia/images/020.png" alt="Logo" />
                                    {% endif%}
                                {% endif%}
                            </div>
                            <div class="user-message-name"><a href="/social/messages_user/{{ usuario.id }}">{{ usuario.first_name }} {{ usuario.last_name }}</a></div>
                            <div class="user-message-last"></div>
                            <div class="clear"></div>
                        </li>
                    {% endfor %}
                </ul>
            {% else %}
                No tienes ningun mensaje recibido
            {% endif %}
        </div>
        <div class="new-message">
            <form action="/social/new_message/">
                <input type="submit" value="Nuevo mensaje" class="submit"/>
            </form>
        </div>
    </div>
{% endblock dashboard %}



